Socket
Socket
Sign inDemoInstall

server-sink

Package Overview
Dependencies
14
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    server-sink

HTTP server response target


Version published
Weekly downloads
4
decreased by-20%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

server-sink stability

npm version build status test coverage downloads js-standard-style

HTTP server response target. Creates a pipeable endpoint that logs out requests and responses with the proper response size.

Usage

const serverSink = require('server-sink')
const bole = require('bole')
const http = require('http')
const fs = require('fs')

const log = bole('app-main')

http.createServer(function (req, res) {
  const sink = serverSink(req, res, log.info)
  const rs = fs.createReadStream('./my-file')
  rs.pipe(sink)
})

API

sink = serverSink(req, res, log)

Create a new sink. Takes an HTTP incomingMessage, serverReponse and log method (bole is recommended, not mandatory).

Installation

$ npm install server-sink

License

MIT

Keywords

FAQs

Last updated on 06 Apr 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc